package com.itgaoshu.hospitalproject.service.impl;

import com.itgaoshu.hospitalproject.bean.Departments;
import com.itgaoshu.hospitalproject.bean.Doctor;
import com.itgaoshu.hospitalproject.bean.Registeredtype;
import com.itgaoshu.hospitalproject.mapper.DoctorMapper;
import com.itgaoshu.hospitalproject.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class DoctorServiceImpl implements DoctorService{
    @Autowired
    private DoctorMapper doctorMapper;

    @Override
    public List<Doctor> doctorList(Doctor doctor) {
        return doctorMapper.doctorList(doctor);
    }

    @Override
    public int deleteDoctor(int doctorId) {
        return doctorMapper.deleteDoctor(doctorId);
    }

    @Override
    public int count(int doctorId) {
        return doctorMapper.count(doctorId);
    }

    @Override
    public List<Departments> findAllDepartments() {
        return doctorMapper.findAllDepartments();
    }

    @Override
    public List<Registeredtype> findAllRegisteredtype() {
        return doctorMapper.findAllRegisteredtype();
    }

    @Override
    public int addDoctor(Doctor doctor) {
        return doctorMapper.addDoctor(doctor);
    }

    @Override
    public int editDoctor(Doctor doctor) {
        return doctorMapper.editDoctor(doctor);
    }

}
